<phone:PhoneApplicationPage
    x:Class="LyonMag.UserComments"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0,0,0,0" Background="#AD1F15" Orientation="Horizontal">
            <Image x:Name="imgLogo" Source="Assets/Licons/navBar.png" Margin="-60,0,0,0" Width="600"/>
            <Button Content="Deconnexion" x:Name="btnLogout" Background="Gray" Width="180" FontSize="20" Visibility="Collapsed" Margin="-280,0,0,0" Foreground="White" Click="btnLogout_Click"></Button>

        </StackPanel>
      
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <StackPanel>
                <TextBlock Text="Déposer un commentaire" Foreground="Black"></TextBlock>
                <StackPanel Orientation="Horizontal">
                    <TextBox Width="350" Height="150" x:Name="txtUserComments" BorderBrush="Orange"></TextBox>
                    <Button Content="Envoyer" Foreground="Black" Background="Gray" x:Name="btnSubmit" Click="btnSubmit_Click" Height="100" Margin="-20,-50,0,0"></Button>
                    
                </StackPanel>
                <StackPanel>
                    <Button Content="Lire l'article" Background="Gray" x:Name="btnArticle" Click="btnArticle_Click"></Button>
                </StackPanel>
            </StackPanel>
            <ListBox x:Name="lstForum" Margin="0,230,0,0">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding Comment_name}" FontSize="30" FontWeight="Bold" TextWrapping="Wrap" Foreground="Black"></TextBlock>
                            <TextBlock Text="{Binding Comment_text}" Foreground="Black" TextWrapping="Wrap"></TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
        <Popup x:Name="popSecond" Grid.Row="2" Margin="35,250,0,0">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <StackPanel Background="Gray" Width="400">
                    <TextBlock Margin="10,0,10,0"  Text="Le commentaire a bien été  ajouté  ." Width="400" TextWrapping="Wrap"></TextBlock>
                    <TextBlock Height="3"></TextBlock>
                    <TextBlock  Margin="10,0,10,0" Text=" Il apparaitra  en ligne dés sa validation par un administrateur." Width="400" TextWrapping="Wrap"></TextBlock>
                    <Button Content="Fermer" x:Name="btnCloseSecond" Click="btnCloseSecond_Click"></Button>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popLoginFailed">
            <StackPanel Background="Black" Opacity="0.8" HorizontalAlignment="Center" Width="400" Margin="50,350,0,0">
                <TextBlock Text="Pseudo ou mot de passe non valide!" HorizontalAlignment="Center"></TextBlock>
                <Button Width="200" HorizontalAlignment="Center" Content="Fermer" x:Name="btnFermerloginfailed" Click="btnFermerloginfailed_Click"></Button>
            </StackPanel>
        </Popup>
        <Popup x:Name="popNickName" Grid.Row="1" VerticalAlignment="Center" Width="800" Margin="40,-100,0,0">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <StackPanel  Width="400" 
                Orientation="Vertical" Background="Gray">
                    <StackPanel>
                        <TextBlock Text="Saisissez votre Pseudo" HorizontalAlignment="Center"></TextBlock>
                    </StackPanel>
                    <StackPanel>
                        <TextBox x:Name="txtNickName"></TextBox>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <Button x:Name="btnEnter" Content="Envoyer" Click="btnEnter_Click"></Button>
                        <Button x:Name="btnCancel" Content="Annuler" Click="btnCancel_Click"></Button>
                    </StackPanel>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popSubmit" Grid.Row="1" Margin="40,250,0,0" >
            <Border CornerRadius="2" BorderBrush="Gray" BorderThickness="5">
                <StackPanel Background="Gray" Width="400">
                    <StackPanel>
                        <TextBlock Margin="10,0,10,0" Width="400"  Text=" Le commentaire a bien été  ajouté  ! Il apparaitra en ligne dés sa validation par un administrateur ." TextWrapping="Wrap"></TextBlock>
                        <TextBlock Text="-" HorizontalAlignment="Center"></TextBlock>
                        <TextBlock Margin="10,0,10,0" Text=" Ce pseudo est disponible, voulez-vous le réserver ?" TextWrapping="Wrap"></TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <Button Content="Reserver" x:Name="btnLogin" Click="btnLogin_Click"></Button>
                        <Button Content="Non merci" x:Name="btnTryAgain" Click="btnTryAgain_Click"></Button>
                    </StackPanel>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popAlert" Margin="20,180,0,0" Grid.Row="2">
            <Border CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
            <StackPanel Background="Gray">
                    <TextBlock Margin="10,0,10,0" Width="400" TextWrapping="Wrap"  Text="Votre compte a bien été créé. Un email de confirmation vient de vous être envoyé." HorizontalAlignment="Center"></TextBlock>
                <TextBlock Height="10" Text="-"></TextBlock>
                    <TextBlock Width="400" Margin="10,0,10,0" TextWrapping="Wrap" Text="     Pour poster des commentaires avec un compte différent, cliquez sur le bouton de déconnexion qui vient d'apparaître en haut de l'écran"></TextBlock>
                <Button Content="Fermer" x:Name="btnAlert" Click="btnAlert_Click"></Button>
            </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="poplogout" Margin="30,250,0,0" Grid.Row="2">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <StackPanel Background="Gray">
                    <TextBlock Margin="10,0,10,0" Width="400" Text="Vous êtes maintenant déconnecté. " HorizontalAlignment="Center" TextWrapping="Wrap"></TextBlock>
                    <TextBlock Height="3"></TextBlock>
                    <TextBlock  Margin="10,0,10,0" Width="400" Text="Pour poster des commentaires avec votre compte,saisissez votre pseudo lors de l'envoi" TextWrapping="Wrap"></TextBlock>
                    <Button Content="Fermer"  Click="Button_Click"></Button>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popLogin" Margin="50,100,0,0" Grid.Row="1">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <Grid VerticalAlignment="Center" HorizontalAlignment="Center" Width="400" Background="Gray">
                    <StackPanel>
                        <StackPanel>
                            <TextBlock Margin="10,0,10,0" Text="Connexion" HorizontalAlignment="Center"></TextBlock>
                        </StackPanel>
                        <StackPanel>
                            <TextBlock Margin="10,0,10,0" Text="Pseudo"></TextBlock>
                            <TextBox x:Name="txtUsernamePassword"></TextBox>
                        </StackPanel>
                        <StackPanel>
                            <TextBlock Text="Mot de passe"></TextBlock>
                            <PasswordBox x:Name="txtPasswordPassword"></PasswordBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Button Content="OK" x:Name="btnLoginUser" Width="200" Click="btnLoginUser_Click"></Button>
                            <Button Content="Annuler" x:Name="btnLoginCancel" Width="200" Click="btnLoginCancel_Click"></Button>
                        </StackPanel>

                    </StackPanel>
                </Grid>
            </Border>
        </Popup>
        <Popup x:Name="popLogins" VerticalAlignment="Center" Grid.Row="1" Margin="50,-100,0,0">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <StackPanel Background="Gray">
                    <StackPanel>
                        <TextBlock Text="Ce nom d'utilisateur est réservé ou incorrect. 
                                   Connectez-vous s'il s'agit du votre." Width="300" TextWrapping="Wrap"></TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Button x:Name="btnLoginnew" Click="btnLoginnew_Click" Content="Se connecter"></Button>
                        <Button x:Name="btnTrynew" Click="btnTrynew_Click" Content="Réessayer"></Button>
                    </StackPanel>
                </StackPanel>
            </Border>
        </Popup>

        <Popup x:Name="popEMail" Margin="150,150,40,0" Grid.Row="2">
            <Border BorderBrush="Gray" BorderThickness="8" CornerRadius="10">
                <StackPanel Background="Gray" HorizontalAlignment="Center">
                    <TextBlock Text="Cet email est incorrect"></TextBlock>
                    <Button Content="Fermer" x:Name="popValidEmail" Click="popValidEmail_Click"></Button>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popRigister" Margin="30,130,0,0" Grid.Row="1">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <Grid VerticalAlignment="Center" HorizontalAlignment="Center" Width="400" Background="Gray">
                    <StackPanel>
                        <StackPanel>
                            <TextBlock Text="Inscription" HorizontalAlignment="Center"></TextBlock>
                        </StackPanel>
                        <StackPanel>
                            <TextBlock Margin="10,0,10,0" Text="Pseudo"></TextBlock>
                            <TextBox  x:Name="txtUserName"></TextBox>
                        </StackPanel>
                        <StackPanel>
                            <TextBlock Margin="10,0,10,0" Text="Email"></TextBlock>
                            <TextBox x:Name="txtEmail"></TextBox>
                        </StackPanel>
                        <StackPanel>
                            <TextBlock  Margin="10,0,10,0" Text="Mot de passe"></TextBlock>
                            <PasswordBox x:Name="txtPasswor"></PasswordBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Button Content="OK" x:Name="btnRegister" Width="200" Click="btnRegister_Click"></Button>
                            <Button Content="Annuler" x:Name="btnCancelRegister" Width="200" Click="btnCancelRegister_Click"></Button>
                        </StackPanel>

                    </StackPanel>
                </Grid>
            </Border>
        </Popup>
    </Grid>
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Se déconnecter" Click="ApplicationBarIconButton_Click"/>

        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>